import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/Login'
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/BaseSystem/LoginSystem.vue')
    },
    {
        path: '/home',
        children: [
            {
                path: 'userOverview',
                component: () => import('@/views/HomePage/UserOverview.vue')
            },
            {
                path: 'assetsOverview',
                component: () => import('@/views/HomePage/AssetsOverview.vue')
            },
        ]
    },
    {
        path: '/data',
        children: [
            {
                path: 'industryAnalysis',
                component: () => import('@/views/DataStatistics/IndustryAnalysis.vue')
            },
            {
                path: 'digitalControl',
                component: () => import('@/views/DataStatistics/DigitalControl.vue')
            },
        ]
    },
    {
        path: '/:pathMatch(.*)*',
        component: () => import('@/views/BaseSystem/NotFound.vue'),
    },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
